import type { EChartsOption } from "echarts";
import * as echarts from 'echarts/core'
import mapData from '../../assets/map.json'

echarts.registerMap('map',mapData as any)
export function getOption(): EChartsOption {
  return {
        tooltip: { // 窗口外框
    backgroundColor: 'rgba(0,0,0,0)',
        trigger: 'item',
  },
    title: {
      show: true,
          left: "center",
          text: "",
          textStyle: {
        color: "#2980b9",
            fontSize: 16
      }
    },
    legend: {
      show: false,
    },
    geo: {
      map: 'map',
      show: false,
      roam: false,
    },
    series: [{
      tooltip: { // 显示的窗口
        show:false,
      },
      name: 'map',
      type: 'map',
      map: 'map', // 自定义扩展图表类型
      zoom: 0.6, //缩放
      showLegendSymbol: false,
      label: { // 文字
        show: true,
        color: '#fff',
        fontSize: 10
      },
      itemStyle: {
        borderColor: 'rgba(147, 235, 248, 1)',
        borderWidth: 1,
        areaColor: {
          type: 'radial',
          x: 0.5,
          y: 0.5,
          r: 0.8,
          colorStops: [{
            offset: 0,
            color: 'rgba(147, 235, 248, 0)' // 0% 处的颜色
          }, {
            offset: 1,
            color: 'rgba(147, 235, 248, .2)' // 100% 处的颜色
          }],
        },
        shadowColor: 'rgba(128, 217, 248, 1)',
        shadowOffsetX: -2,
        shadowOffsetY: 2,
        shadowBlur: 10,
      },
      emphasis: { //鼠标移入动态的时候显示的默认样式
        disabled:true
      },
      layoutCenter: ['50%', '50%'],
      layoutSize: '150%',
      markPoint: {
        symbol: 'none'
      },
    }
    ]
  }
}
